# components/postprocessors.py

from llama_index.core.postprocessor import MetadataReplacementPostProcessor, SentenceTransformerRerank
from ..config import settings

def get_metadata_replacement_postprocessor():
    """Creates a MetadataReplacementPostProcessor."""
    print("⚙️ [Postprocessors] Creating Metadata Replacement Postprocessor...")
    return MetadataReplacementPostProcessor(
        target_metadata_key=settings.METADATA_REPLACEMENT_KEY
    )

def get_sentence_transformer_reranker():
    """Creates a SentenceTransformerRerank postprocessor."""
    print("⚙️ [Postprocessors] Creating Sentence Transformer Reranker...")
    return SentenceTransformerRerank(
        model=settings.RERANKER_MODEL,
        top_n=settings.RERANKER_TOP_N
    )